package de.lazy.gui.accessory;

import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class ImageFactory {

	
	public static Image getScaledImage(File imageFile,int width, int heigth) throws IOException{
		BufferedImage img = null;
		try {
		    img = ImageIO.read(imageFile);
		} catch (IOException e) {
			System.err.println("Error reading '"+imageFile.getAbsolutePath()+"'");
		    throw e;
		}
		
		return img.getScaledInstance(width, heigth, Image.SCALE_SMOOTH);
	}
	

	
}
